import '../../utils/concrete'

/* 查询泊位 */
export function selBreth(param, pageSize, pageNum) {
  const data = {
    condition: {
      place_chargeunit: param.roadno,
      place_id: param.berthNo,
      place_no: param.roadNum,
      place_park: param.parkNo,
      place_roadkind: param.isDemo,
      place_status: param.berthStatus,
      place_type: param.berthType
    },
    num: pageNum,
    pageSize: pageSize
  }
  return concrete.module('BaseplaceService').selectBaseplace(data)
}
/* 添加泊位 */
export function addBreth(param) {
  const data = {
    place_car: '',
    place_chargeunit: param.roadsNum,
    place_chargeunitname: param.roads,
    place_dc: param.terrestrial,
    place_id: param.berthNO,
    place_lati: param.lat,
    place_long: param.longirude,
    place_no: param.roadsNo,
    place_park: param.parkNo,
    place_parkname: param.parkName,
    place_remark: param.remarks,
    place_sfdwname: '',
    place_size: param.berthSize,
    place_status: param.berthStatus,
    place_type: param.berthType
  }
  return concrete.module('BaseplaceService').saveBaseplace(data)
}
/* 编辑泊位 */
export function editBreth(param) {
  const data = {
    place_park: param.place_park,
    place_parkname: param.place_parkname,
    place_id: param.place_id,
    place_chargeunitname: param.place_chargeunitname,
    place_chargeunit: param.place_chargeunit,
    place_no: param.place_no,
    place_type: param.place_type,
    place_status: param.place_status,
    place_long: param.place_long,
    place_lati: param.place_lati,
    place_size: param.place_size,
    place_dc: param.place_dc,
    place_remark: param.place_remark,
    place_sfdwname: ''
  }
  return concrete.module('BaseplaceService').updateBaseplace(data)
}
/* 删除泊位 */
export function delBerth(param) {
  return concrete.module('BaseplaceService').deleteBaseplace(param)
}
